package com.soilflow.web.controller.auction;

import com.soilflow.common.core.controller.BaseController;
import com.soilflow.common.core.domain.AjaxResult;
import com.soilflow.common.core.page.TableDataInfo;
import com.soilflow.common.domain.LandAuction;
import com.soilflow.common.domain.LandAuctionEnroll;
import com.soilflow.common.domain.dto.LandAuctionEnrollDto;
import com.soilflow.common.domain.vo.LandAuctionEnrollVo;
import com.soilflow.info.service.LandAuctionEnrollService;
import com.soilflow.info.service.LandAuctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 竞拍
 */
@RequestMapping("/auction/enroll")
@RestController
public class LandAuctionEnrollController extends BaseController {


    @Autowired
    private LandAuctionEnrollService landAuctionEnrollService;


    /**
     * 竞拍报名信息列表
     * @param dto
     * @return
     */
    @GetMapping("/list")
    public TableDataInfo auctionEnrollInfoList(LandAuctionEnrollDto dto)
    {
        startPage();
        List<LandAuctionEnrollVo> list = landAuctionEnrollService.auctionEnrollInfoList(dto);
        return getDataTable(list);
    }



    /**
     * 删除竞拍报名
     * @return
     */
    @DeleteMapping("del/{ids}")
    public AjaxResult delAuctionEnrollInfo(@PathVariable List<Long> ids){
        landAuctionEnrollService.removeByIds(ids);
        return AjaxResult.success();
    }





}
